<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>高考分数线查询系统</title>
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/bootstrap.min.css">
</head>
<style>
    .menu {
        padding: 0 10px 10px;
    }

    .dataTables_wrapper {
        width: 1000px;
    }
</style>
<body>
<nav class="navbar navbar-default" role="navigation">
    <div class="container-fluid">
        <div class="navbar-header">
            <a class="navbar-brand" href="province.html">各省份历年录取分数查询</a>
        </div>
        <div class="navbar-header">
            <a class="navbar-brand" href="college.html">各院校录取分数线查询</a>
        </div>
        <div class="navbar-header">
            <a class="navbar-brand" href="https://www.eol.cn/e_html/gk/chafen/index.shtml">高考查分</a>
        </div>
        <div class="navbar-header">
            <a class="navbar-brand" href="https://gkcx.eol.cn/">志愿填报</a>
        </div>
        <div class="navbar-header">
            <a class="navbar-brand" href="http://query.bjeea.cn/queryService/rest/admission/110">录取通知书查询</a>
        </div>
        <div class="navbar-header">
            <a class="navbar-brand" href="https://gkcx.eol.cn/school/search">院校排行</a>
        </div>
        <div class="navbar-header">
            <a class="navbar-brand" href="time.html">高考时间查询</a>
        </div>
        <div class="navbar-header">
            <a class="navbar-brand" href="major.html">专业查询</a>
        </div>
    </div>
</nav>
<div class="menu">
    <select id="SEL" class="combobox" data-style="btn-primary" onchange="Show(this.value)"></select>
    <button id="search_city" onclick="search_city">查看录取分数线</button>
</div>
<div class="dataTables_wrapper"></div>
</body>
<script type="text/javascript" src="http://www.jb51.net/jslib/jquery/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script type="text/javascript">
    function gaokao(result) {
        sessionStorage.setItem('province', JSON.stringify(result))
    }

    var citylist = [{'name': '北京', 'vaule': 'beijing'}, {'name': '天津', 'vaule': 'tianjin'}, {
        'name': '江苏',
        'vaule': 'jiangsu'
    }, {'name': '浙江', 'vaule': 'zhejiang'}, {'name': '重庆', 'vaule': 'chongqing'}, {
        'name': '上海',
        'vaule': 'shanghai'
    }, {'name': '广东', 'vaule': 'guangdong'}, {'name': '山东', 'vaule': 'shandong'}, {
        'name': '湖北',
        'vaule': 'hubei'
    }, {'name': '湖南', 'vaule': 'hunan'}, {'name': '陕西', 'vaule': 'shanxi'}, {
        'name': '山西',
        'vaule': 'sx'
    }, {'name': '四川', 'vaule': 'sichuan'}, {'name': '福建', 'vaule': 'fujian'}, {
        'name': '安徽',
        'vaule': 'anhui'
    }, {'name': '辽宁', 'vaule': 'liaoning'}, {'name': '江西', 'vaule': 'jiangxi'}, {
        'name': '海南',
        'vaule': 'hainan'
    }, {'name': '宁夏', 'vaule': 'ningxia'}, {'name': '吉林', 'vaule': 'jilin'}, {
        'name': '云南',
        'vaule': 'yunnan'
    }, {'name': '广西', 'vaule': 'guangxi'}, {'name': '贵州', 'vaule': 'guizhou'}, {
        'name': '青海',
        'vaule': 'qinghai'
    }, {'name': '甘肃', 'vaule': 'gansu'}, {'name': '河北', 'vaule': 'hebei'}, {
        'name': '河南',
        'vaule': 'henan'
    }, {'name': '新疆', 'vaule': 'xinjiang'}, {'name': '西藏', 'vaule': 'xizang'}, {
        'name': '黑龙江',
        'vaule': 'heilongjiang'
    }, {'name': '内蒙古', 'vaule': 'neimenggu'}]
    var option = ""
    citylist.map(function (item) {
        option += "<option value=" + item.vaule + ">" + item.name + "</option>"
    })
    $('#SEL').append(option)
    add_table($('#SEL').val())

    function Show(value) {
        // console.log(value, $('#SEL').val())
    }

    $('#search_city').click('', function search_city() {
        add_table($('#SEL').val())
    })

    function add_table(now_city) {
        result = JSON.parse(sessionStorage.getItem('province'))
        var table_html = ""
        result.map(function (item) {
            for (var city in item['table']) {
                if (now_city == city) {
                    table_html += item['table'][city]
                }
            }
            $('.dataTables_wrapper').html(table_html)
        })
    }
</script>
<script type="text/javascript" src="province.json?callback=gaokao"></script>

</html>